﻿using Microsoft.Xna.Framework;

namespace ShevaEngine.Core.Modules.Scenes
{
    /// <summary>
    /// Graphics scene object transformation.
    /// </summary>
    public class GraphicsSceneObjectTransformation : GraphicsSceneObjectNode
    {
        /// <summary>Transformation matrix.</summary>
        public Matrix TransformationMatrix;

        /// <summary>
        /// Constructor.
        /// </summary>
        public GraphicsSceneObjectTransformation()
            : base()
        {
            this.TransformationMatrix = Matrix.Identity;
        }

        /// <summary>
        /// Override Add in rendering pipeline method.
        /// </summary>
        /// <param name="renderingPipeline"></param>
        /// <param name="worldMatrix"></param>
        public override void AddInRenderingPipeline(Graphics.RenderingPipeline renderingPipeline, Matrix worldMatrix)
        {
            base.AddInRenderingPipeline(renderingPipeline, this.TransformationMatrix * worldMatrix);
        }
    }
}
